<div class="box is-shadowless">
  <PageHeader as |p|>
    <p.top>
      <nav class="breadcrumb">
        <li>
          {{#link-to params=(if model.backend
              (array "vault.cluster.secrets.backend.list-root")
              (array "vault.cluster.secrets")
            )
          }}
            <span class="sep">&#x0002f;</span>
            {{if model.backend model.backend 'secrets'}}
          {{/link-to}}
        </li>
      </nav>
    </p.top>
    <p.levelLeft>
      <h1 class="title is-3 has-text-grey">
        {{#if (eq model.httpStatus 404)}}
          404 Not Found
        {{else if (eq model.httpStatus 403)}}
          Not Authorized
        {{else}}
          Error
        {{/if}}
      </h1>
    </p.levelLeft>
  </PageHeader>
  <div class="box is-sideless has-background-white-bis has-text-grey has-text-centered">
    {{#if (eq model.httpStatus 404)}}
      <p data-test-secret-not-found>
        Unable to find secret at <code>{{concat model.backend "/" model.secret}}</code>. Try going back to the
        {{#link-to params=(if model.backend
            (array "vault.cluster.secrets.backend.list-root")
            (array "vault.cluster.secrets")
          )
        }}root{{/link-to}}
        and navigating from there.
      </p>
    {{else if (eq model.httpStatus 403)}}
      {{#if (eq model.policyPath 'sys/capabilities-self') }}
        <p>
          Your auth token does not have access to <code>{{model.policyPath}}</code>. Vault Enterprise uses this endpoint to determine what actions are allowed in the interface.
        </p>
        <p>
          Make sure the policy for the path <code>{{model.policyPath}}</code> includes <code>capabilities = ['update']</code>.
        </p>
      {{else}}
        <p>
          You don't have access to <code>{{if model.secret (concat model.backend '/' model.secret) (concat model.backend '/')}}</code>. If you think you've reached this page in error, please contact your administrator.
        </p>
        <p>
          {{#if model.secret}}
            {{#link-to "vault.cluster.secrets.backend.list-root"}}Navigate back to the root{{/link-to}}.
          {{else}}
            {{#home-link}}Go back home{{/home-link}}.
          {{/if}}
        </p>
      {{/if}}
    {{else}}
      {{#if model.message}}
        <p>{{model.message}}</p>
      {{/if}}
      {{#each model.errors as |error|}}
        <p class="message">
          {{error}}
        </p>
      {{/each}}
    {{/if}}
  </div>
</div>
